<!DOCTYPE html>
<html>
<head lang="ZH">
    <meta charset="UTF-8">
    <title>APP_NAME:APP_VERSION</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link href="./assets/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
    <style>
        p {
            padding: 5px;
        }
    </style>
</head>

<body style="text-align: center">
<img src="assets/img/app_logo.png" style="width: 100%;">
<p>
    <a class="btn btn-primary btn-lg btn-block downloadBtn">下载安装APP</a>
</p>
<p>
    版本: APP_VERSION
</p>
<p>
    特别提示：
</p>
<p>
    由于iOS应用涉及到苹果收费开发账户、证书签名等敏感信息不便于演示分发，社区版本仅提供Android版本，暂不提供iOS版本下载安装
</p>
<p>
    专业版本中提供完整的 WMWare MacOSX 虚拟操作系统 + Android SDK/Xcode + Jenkins 全自动持续集成分发apk、plist和ipa安装文件的文档和资料
</p>

<div id="weixinAndroidTips" style="display: none; position: absolute; left:0px; top:0px;width: 100%">
    <img src="assets/img/weixin-open-android.png" style="width: 100%;">
</div>

<div id="weixiniOSTips" style="display: none; position: absolute; left:0px; top:0px;width: 100%">
    <img src="assets/img/weixin-open-ios.png" style="width: 100%;">
</div>

<script src="assets/js/jquery.min.js"></script>
<script type="text/javascript">
    var version = navigator.userAgent;
    var href = window.location.href;
    var reg = /(.*)index.html.*/gi;
    var prefix = reg.exec(href);
    if (prefix != null) {
        prefix = prefix[1];
    } else {
        prefix = href;
    }
    if (version.indexOf('iPhone') > -1 || version.indexOf('iPad') > -1) {
        if (version.indexOf('MicroMessenger') > -1) {
            $('.downloadBtn').click(function () {
                $("#weixiniOSTips").show();
            });
        } else {
            $('.downloadBtn').attr('href', 'itms-services://?action=download-manifest&url=' + prefix.replace('http:', 'https:') + 'app/ios/EntDIY.plist');
        }
    } else if (version.indexOf('Android') > -1) {
        if (version.indexOf('MicroMessenger') > -1) {
            $('.downloadBtn').click(function () {
                $("#weixinAndroidTips").show();
            });
        } else {
            $('.downloadBtn').attr('href', prefix + 'app/android/EntDIY.apk');
        }
    } else {
        $('.downloadBtn').click(function () {
            alert("请使用移动设备浏览器访问当前页面地址");
        });
    }
</script>
</body>
</html>